{% extends 'admin/common/base.html'%}

{%block body%}
<!-- 头部 -->
{% include 'admin/common/top.html' %}
<!-- /头部 -->

<div class="main-container container-fluid">
    <div class="page-container">
        {% include 'admin/common/left.html' %}
        <div class="page-content">
            <div class="page-breadcrumbs">
                <ul class="breadcrumb">
                    <li>
                        <a href="#">标签管理</a>
                    </li>
                    <li class="active">标签列表</li>
                </ul>
            </div>
            <div class="page-body">
                <a type="button" tooltip="添加用户" class="btn btn-sm btn-azure btn-addon"
                    href="{{url_for('tag.add_tag')}}"> <i class="fa fa-plus"></i> Add
                </a>
                
                {% for message in get_flashed_messages() %}
                <div class="red" style="line-height: 50px;">{{ message }}</div>
                {% endfor %}

                <div class="row">
                    <div class="col-lg-12 col-sm-12 col-xs-12">
                        <div class="widget">
                            <div class="widget-body">
                                <div class="flip-scroll">
                                    <table class="table table-bordered table-hover">
                                        <thead class="">
                                            <tr>
                                                <th class="text-center" width="4%">ID</th>
                                                <th class="text-center">标签名称</th>
                                                <th class="text-center">修改时间</th>
                                                <th class="text-center">创建时间</th>
                                                <th class="text-center" width="16%">操作</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            {% for item in pagination.items %}
                                            <tr>
                                                <td align="center">{{item.id}}</td>
                                                <td align="center">{{item.tagname}}</td>
                                                <td align="center">{{item.update_time}}</td>
                                                <td align="center">{{item.create_time}}</td>
                                                <td align="center">
                                                    <a href="{{url_for('tag.edit_tag', id=item.id)}}"
                                                        class="btn btn-primary btn-sm shiny">
                                                        <i class="fa fa-edit"></i> 编辑
                                                    </a>
                                                    <a href="#" onClick="del('{{item.id}}')"
                                                        class="btn btn-danger btn-sm shiny">
                                                        <i class="fa fa-trash-o"></i> 删除
                                                    </a>
                                                </td>
                                            </tr>
                                            {% endfor%}
                                        </tbody>
                                    </table>
                                </div>
                                <div style="text-align:right; margin-top:10px;">
                                    {{ page_func.render_pagination(pagination, 'tag.tag') }}
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>
<script>
    function del(id) {
        warning('确实要删除吗', "{{url_for('tag.del_tag')}}?id=" + id)
    }
</script>
{%endblock%}